<?php
class IndexController extends Zend_Controller_Action {	
	public function e404Action() {	
		include_once('index/e404.php');
	}
	public function indexAction() {	
		include_once('index/index.php');
	}
	public function loginAction() {
		include_once('index/login.php');
	}
	public function loginerrAction() {
		include_once('index/login-error.php');
	}
	public function logoutAction() {
		$AppUI = Zend_Registry::get('AppUI');
		if ($AppUI->id > 0) {			
			Vfriend_Session::end(0);
			if (isset($_SESSION) && $_SESSION) {
				session_regenerate_id();
				foreach ($_SESSION as $key=>$value) {
					if ($key != SESSION_BACKURL && $key != 'VFRIEND_MESSAGE') {
						unset($_SESSION[$key]);
					}
				}
			}
			if (isset($_COOKIE[COOKIE_VFRIEND_AUTH]) && $_COOKIE[COOKIE_VFRIEND_AUTH] != '') {
				$arrCookieAuth 	= explode('::', Vfriend_Function::base64D($_COOKIE[COOKIE_VFRIEND_AUTH]));
				$strEmail 		= $arrCookieAuth[0];
				$strPassword 	= $arrCookieAuth[1];
				$intLength		= $arrCookieAuth[2];
				$strCookies 	= $strEmail . '::' . $strPassword . '::' . $intLength . '::0';
				Vfriend_Function::setCookie(COOKIE_VFRIEND_AUTH, Vfriend_Function::base64E($strCookies));
			}
			$this->_redirect(isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : HOST_VFRIEND);
		} else {
			$this->_redirect(HOST_VFRIEND);
		}
	}
	public function registerAction() {
		include_once('index/register.php');
	}
	public function saveAction() {
		include_once('index/register-save.php');
	}
	public function activehelpAction() {
		include_once('index/register-active-help.php');
	}
	public function activeaccountAction() {
		include_once('index/register-active-account.php');
	}
	public function forgetpasswordAction() {
		include_once('index/user-forget-password.php');
	}
	public function doforgetpasswordAction() {
		include_once('index/user-forget-password-submit.php');
	}
	public function resetpasswordAction() {
		include_once('index/user-reset-password.php');
	}
	public function doresetpasswordAction() {
		include_once('index/user-reset-password-submit.php');
	}
	public function getcodeaccountAction() {
		include_once('index/user-getcode-account.php');
	}
	public function dogetcodeaccountAction() {
		include_once('index/user-getcode-account-submit.php');
	}
	public function verifiedemailAction() {
		include_once('index/user-change-email.php');
	}
	public function doinviteAction() {
		include_once('index/invite.php');
	}
}
?>